#ifndef MATRIX_H
#define MATRIX_H

#include <stack>
#include <stdio.h>
#include <math.h>

class Matrix4
{
    public :

    /*!******************************************/
    /*!				Properties					*/
    /*!******************************************/

    float * array;

    float m00, m01, m02, m03;
    float m10, m11, m12, m13;
    float m20, m21, m22, m23;
    float m30, m31, m32, m33;

    std::stack<Matrix4> pile;       /*!< Store the Inverse Matrix  // à implémenter  */

    /*!******************************************/
    /*!				Constructors				*/
    /*!******************************************/

    /* @brief Build a new Matrix with default identity values  */

    Matrix4();

    /*  @brief Build a new matrix using float array             */

    Matrix4(float * aArray);

    /*	@brief Copy constructor                                 */

    Matrix4(const Matrix4 & matCopie);

    ~Matrix4();

    /*!******************************************/
    /*!				Methods						*/
    /*!******************************************/

    /*  @brief  Multiply the current matrix by the specified translation    */

    void Translate(float x, float y, float z);

    /*  @brief  Multiply the current matrix by the specified Rotation       */

    void Rotatex(float angle);
    void Rotatey(float angle);
    void Rotatez(float angle);

    /*!******************************************/
    /*!				Static						*/
    /*!******************************************/

    /*  @brief Return the Translation Matrix                */

    static Matrix4 Translation  (float x, float y, float z);

    /*  @brief Return the corresponding Rotation matrix     */

    static Matrix4 Rotation     (float x, float y, float z);





    float GetElement(int i);
    float * GetArray();

    Matrix4 operator *(Matrix4 );
    void operator =(const Matrix4 & );

    void Print();
    void Identity();

    void Perspective(float angle, float ratio, float near, float far);

    void Push();
    void Pop();


};


#endif // MATRIX_H
